/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ScorePaneel.java
 *
 * Created on 8-jun-2009, 15:39:47
 */
package be.khl.kevinvranken.breekuit;

/**
 *
 * @author Kevin
 */
public class ScorePaneel extends javax.swing.JPanel {

    /** Creates new form ScorePaneel */
    public ScorePaneel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        score = new javax.swing.JLabel();
        ballen = new javax.swing.JLabel();

        setBackground(new java.awt.Color(0, 0, 0));
        setForeground(new java.awt.Color(255, 255, 0));
        setAlignmentX(0.0F);
        setAlignmentY(0.0F);
        setFocusable(false);
        setMaximumSize(new java.awt.Dimension(200, 550));
        setMinimumSize(new java.awt.Dimension(200, 550));
        setPreferredSize(new java.awt.Dimension(200, 550));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 0));
        jLabel1.setText("Score:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 0));
        jLabel2.setText("Resterende ballen:");

        score.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        score.setForeground(new java.awt.Color(255, 255, 0));
        score.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        score.setText("0");
        score.setFocusable(false);

        ballen.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        ballen.setForeground(new java.awt.Color(255, 255, 0));
        ballen.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        ballen.setText("3");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(score, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(ballen, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(score)
                    .addComponent(jLabel1))
                .addGap(27, 27, 27)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ballen)
                    .addComponent(jLabel2))
                .addContainerGap(545, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel ballen;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel score;
    // End of variables declaration//GEN-END:variables
    private int huidigeScore = 0;

    /**
     * @param score the score to set
     */
    public void setScore(int score) {
        huidigeScore += score;
        this.score.setText(String.valueOf(huidigeScore));
        repaint();
    }

    public void setBallen(int ballen) {
        this.ballen.setText(String.valueOf(ballen));
        repaint();
    }

    public void resetScore(){
       setScore(huidigeScore*-1);
    }
}
